﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yto.Common.Dependency;

namespace Yto.Common.Configuration
{
    public class StartupConfiguration : BaseConfig, IStartupConfiguration
    {
        public string DefaultNameOrConnString { get; set; }

        public ICtnManager CtnManager { get; }


        public StartupConfiguration(ICtnManager ctnManager)
        {
            CtnManager = ctnManager;
        }

        public T Get<T>()
        {
            return GetOrCreate(typeof(T).FullName, () => CtnManager.Resolver<T>());
        }
    }
}
